import 'package:fish_redux/fish_redux.dart';
import '../../../../app_files.dart';

class SearchResultViewState implements Cloneable<SearchResultViewState> {
  ///当前文章列表
  List items;

  ///当前页码
  int currentPage = 1;
  int status = 0;

  ///页面控制器
  EasyRefreshController refreshController = EasyRefreshController();
  int type;

  /// 1 安检员 2 户 3 小区
  String keyword;
  String heroTag;

  String communityID;
  String communityName;
  String planID;
  String workID;
  bool isBuildingNo = false;

  @override
  SearchResultViewState clone() {
    return SearchResultViewState()
      ..items = items
      ..currentPage = currentPage
      ..refreshController = refreshController
      ..type = type
      ..keyword = keyword
      ..heroTag = heroTag
      ..communityName = communityName
      ..communityID = communityID
      ..workID = workID
      ..status = status
      ..isBuildingNo = isBuildingNo
      ..planID = planID;
  }
}

SearchResultViewState initState(Map<String, dynamic> args) {
  return SearchResultViewState()
    ..type = args['type']
    ..status = args['status']
    ..keyword = args['keyword']
    ..communityID = args['communityID']
    ..communityName = args['communityName']
    ..workID = args['workID']
    ..planID = args['planID']
    ..isBuildingNo = args['isBuildingNo']
    ..heroTag = args['tag'];
}
